/*
 *  $Id: StrikeRedirect.cs 898 2009-11-28 16:12:26Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Affects {
    /// <summary>
    /// Эффект: перенаправление ударов
    /// Все удары по владельцу эффекта перенаправляются на указанное существо.
    /// </summary>
    public class StrikeRedirect: Affect {
        public static readonly Languages.Phrase Action = new Languages.Phrase("affect.strike_redirect.action");

        public readonly AbstractObject From;
        public readonly Creature To;

        public StrikeRedirect(AbstractObject from, Creature to) {
            From = from;
            To = to;
        }

        public override string Id {
            get { return "strike_redirect"; }
        }
        public override string NameText {
            get { return Name.GetText(To); }
        }

        public override Affect Clone() {
            return new StrikeRedirect(From, To);
        }

        public override void SetAffect() {
            base.SetAffect();
            From.Summary.StrikeRedirects.Add(this);
        }
        public override void ResetAffect() {
            base.ResetAffect();
            From.Summary.StrikeRedirects.Remove(this);
        }
    }
}